<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <include file="Common/meta" />
    <title>找回密码 - {$_ENV['site'][0]['title']}</title>
    <include file="Common/link" />
</head>
<body>
<header class="layout-header">
    <div class="container">
        <h1 class="title">忘记密码</h1>
        <a class="header-back" href="#"><i class="icon icon-left"></i></a>
    </div>
</header>
<div class="layout-body">
    <div class="container">
        <section class="box box-login">
            <div class="box-body">
                <div class="logo-box">
                    <div class="logo-text"></div>
                </div>
                <form>
                    <input id="account" class="input-account find-pwd" value="" placeholder="邮箱">
                    <button id="btn-ok" class="btn-login" type="button">确定</button>
                </form>
            </div>

        </section>

    </div>
</div>
<script>
    var page = {
        loginUrl: '/User/login'
    };
</script>
<include file="Common/script" />
<script>
    $(document).ready(function () {
        // 找回密码
        $('#btn-ok').on('click', function() {
            var account = $('#account').val();
            if (!account) {
                eui.msg('邮箱不可为空');
                return;
            }

            $.ajax({
                url: '/user/findPswd',
                data: {
                    user: account,
                },
                type: 'POST',
                dataType: 'json',
                success: function (obj) {
                    if (obj.code === 0) {
                        eui.alert(obj.msg + ',请查收!');
                    } else {
                        eui.msg('操作失败，' + obj.msg);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    eui.msg('系统出错');
                }
            });
        });
    });

</script>
</body>
</html>



